Repository navigation
feat(storybook): name screenshots per browser when running several browsers - #423
Merged
Merged
Conversation
Several browsers (Vitest browser `instances`, the test-runner's `--browsers`) wrote screenshots under the same story names, so the last browser overwrote the others. Screenshots taken outside Chromium now end with ` browser-[<name>]`, after the mode, so each browser gets its own baselines. Chromium keeps the plain name: existing baselines stay valid, including when a browser is added to the run. Fixes ARG-517 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vitest runs each browser of `browser.instances` as a project of its own and calls `configureVitest` for each, so `uploadToArgos` added one reporter, and uploaded the screenshots once, per browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rule that Chromium keeps the plain name and other browsers get ` browser-[<name>]` moves to `getBrowserSuffix` in `@argos-ci/util`, next to the viewport suffix, so `@argos-ci/vitest` can use the same definition. Storybook only puts its mode in front of it. Also turns the naming tests into tables and builds the plugin tests from one `configure()` helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 of 6 tasks
gregberge
deleted the
claude/storybook-screenshots-per-browser-282e1c
branch
November 17, 2026 14:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes ARG-517.
When several browsers capture the same stories, every screenshot was named after its story id only and written to the same directory, so the last browser overwrote the others. This applies to Vitest browser
instancesand to the test-runner's--browsers. Both are confirmed: a three-browser run produced a single set of screenshots.Naming
Screenshots taken outside Chromium now end with
browser-[<name>], after the mode:example-button--primary mode-[dark](Chromium, unchanged)example-button--primary mode-[dark] browser-[firefox]example-button--primary/in-play mode-[dark] browser-[webkit](in-playargosScreenshot)Chromium keeps the plain name, so existing baselines stay valid, even when a browser is added to an existing setup. Names also don't change when a run is filtered with
--projector--browser.Where the browser name comes from:
ctx.project.config.browser.name. Each instance is a project of its own, and this is set even withpersistentContext, where Playwright'scontext.browser()isnull.page.context().browser()?.browserType().name().The browser was already recorded in the screenshot metadata by
@argos-ci/playwright, so that part needed no change.Single upload with several browsers
Vitest calls the plugin's
configureVitestonce per instance project, souploadToArgosadded oneArgosReporterper browser and uploaded the screenshots that many times. The plugin now creates its reporter once and adds it only if it isn't there yet. This is a separatefixcommit.Type of changes
enhancement, plus abugfix for the duplicate upload.Checklist
Optional checks:
Further comments
Checked locally against
packages/storybook's stories, with Chromium, Firefox and WebKit. A temporary config was used and isn't committed:instances: [chromium, firefox, webkit]uploadToArgos: true, no tokentest-storybook --browsers chromium firefox webkitThe e2e config still runs Chromium only, so the CI Argos builds keep their names.
Known limits:
@argos-ci/vitesthas the same two problems (names without the browser, one reporter per instance). That will come in a separate PR. The docs need a note on per-browser names once this is released.🤖 Generated with Claude Code